package cn.netshop.pojo.;

import com.alibaba.fastjson.JSONObject;

/**
 * tb_sku实体类
 * 
 * @author 
 *
 */
public class TbSku {
	/**商品id*/
	private String id; 
	/**商品条码*/
	private String sn; 
	/**SKU名称*/
	private String name; 
	/**价格（分）*/
	private Integer price; 
	/**库存数量*/
	private Integer num; 
	/**库存预警数量*/
	private Integer alertNum; 
	/**商品图片*/
	private String image; 
	/**商品图片列表*/
	private String images; 
	/**重量（克）*/
	private Integer weight; 
	/**创建时间*/
	private java.time.Instant createTime; 
	/**更新时间*/
	private java.time.Instant updateTime; 
	/**SPUID*/
	private String spuId; 
	/**类目ID*/
	private Integer categoryId; 
	/**类目名称*/
	private String categoryName; 
	/**品牌名称*/
	private String brandName; 
	/**规格*/
	private String spec; 
	/**销量*/
	private Integer saleNum; 
	/**评论数*/
	private Integer commentNum; 
	/**商品状态 1-正常，2-下架，3-删除*/
	private String status; 
	/***/
	private Integer version; 
	/**
	 * 实例化
	 */
	public TbSku() {
		super();
	}
	/**
	 * 实例化
	 * 
	 * @param obj
	 */
	public TbSku(JSONObject obj) {
		this();
		if (obj.get("id") instanceof String) {
			this.setId((String) obj.get("id"));
		}
		if (obj.get("sn") instanceof String) {
			this.setSn((String) obj.get("sn"));
		}
		if (obj.get("name") instanceof String) {
			this.setName((String) obj.get("name"));
		}
		if (obj.get("price") instanceof Number) {
			this.setPrice(((Number) obj.get("price")).intValue());
		}
		if (obj.get("num") instanceof Number) {
			this.setNum(((Number) obj.get("num")).intValue());
		}
		if (obj.get("alertNum") instanceof Number) {
			this.setAlertNum(((Number) obj.get("alertNum")).intValue());
		}
		if (obj.get("image") instanceof String) {
			this.setImage((String) obj.get("image"));
		}
		if (obj.get("images") instanceof String) {
			this.setImages((String) obj.get("images"));
		}
		if (obj.get("weight") instanceof Number) {
			this.setWeight(((Number) obj.get("weight")).intValue());
		}
		this.setCreateTime(obj.get("createTime"));
		this.setUpdateTime(obj.get("updateTime"));
		if (obj.get("spuId") instanceof String) {
			this.setSpuId((String) obj.get("spuId"));
		}
		if (obj.get("categoryId") instanceof Number) {
			this.setCategoryId(((Number) obj.get("categoryId")).intValue());
		}
		if (obj.get("categoryName") instanceof String) {
			this.setCategoryName((String) obj.get("categoryName"));
		}
		if (obj.get("brandName") instanceof String) {
			this.setBrandName((String) obj.get("brandName"));
		}
		if (obj.get("spec") instanceof String) {
			this.setSpec((String) obj.get("spec"));
		}
		if (obj.get("saleNum") instanceof Number) {
			this.setSaleNum(((Number) obj.get("saleNum")).intValue());
		}
		if (obj.get("commentNum") instanceof Number) {
			this.setCommentNum(((Number) obj.get("commentNum")).intValue());
		}
		if (obj.get("status") instanceof String) {
			this.setStatus((String) obj.get("status"));
		}
		if (obj.get("version") instanceof Number) {
			this.setVersion(((Number) obj.get("version")).intValue());
		}
	}
	
	/**
	 * 将当前对象转换为JsonObject
	 * 
	 * @return
	 */
	public JSONObject toJson() {
		JSONObject result = new JSONObject();
		if (this.getId() != null) {
			result.put("id",this.getId());
		}
		if (this.getSn() != null) {
			result.put("sn",this.getSn());
		}
		if (this.getName() != null) {
			result.put("name",this.getName());
		}
		if (this.getPrice() != null) {
			result.put("price",this.getPrice());
		}
		if (this.getNum() != null) {
			result.put("num",this.getNum());
		}
		if (this.getAlertNum() != null) {
			result.put("alertNum",this.getAlertNum());
		}
		if (this.getImage() != null) {
			result.put("image",this.getImage());
		}
		if (this.getImages() != null) {
			result.put("images",this.getImages());
		}
		if (this.getWeight() != null) {
			result.put("weight",this.getWeight());
		}
		if (this.getCreateTime() != null) {
			result.put("createTime",this.getCreateTime());
		}
		if (this.getUpdateTime() != null) {
			result.put("updateTime",this.getUpdateTime());
		}
		if (this.getSpuId() != null) {
			result.put("spuId",this.getSpuId());
		}
		if (this.getCategoryId() != null) {
			result.put("categoryId",this.getCategoryId());
		}
		if (this.getCategoryName() != null) {
			result.put("categoryName",this.getCategoryName());
		}
		if (this.getBrandName() != null) {
			result.put("brandName",this.getBrandName());
		}
		if (this.getSpec() != null) {
			result.put("spec",this.getSpec());
		}
		if (this.getSaleNum() != null) {
			result.put("saleNum",this.getSaleNum());
		}
		if (this.getCommentNum() != null) {
			result.put("commentNum",this.getCommentNum());
		}
		if (this.getStatus() != null) {
			result.put("status",this.getStatus());
		}
		if (this.getVersion() != null) {
			result.put("version",this.getVersion());
		}
		return result;
	}
	
	
	/**
	 * 获取id
	 * 
	 * @return
	 */
	public String getId() {
		return id;
	}

	/**
	 * 设置id
	 * 
	 * @param id
	 */
	public void setId(String id) {
		this.id = id;
	}
	
	/**
	 * 获取sn
	 * 
	 * @return
	 */
	public String getSn() {
		return sn;
	}

	/**
	 * 设置sn
	 * 
	 * @param sn
	 */
	public void setSn(String sn) {
		this.sn = sn;
	}
	
	/**
	 * 获取name
	 * 
	 * @return
	 */
	public String getName() {
		return name;
	}

	/**
	 * 设置name
	 * 
	 * @param name
	 */
	public void setName(String name) {
		this.name = name;
	}
	
	/**
	 * 获取price
	 * 
	 * @return
	 */
	public Integer getPrice() {
		return price;
	}

	/**
	 * 设置price
	 * 
	 * @param price
	 */
	public void setPrice(Integer price) {
		this.price = price;
	}
	
	/**
	 * 获取num
	 * 
	 * @return
	 */
	public Integer getNum() {
		return num;
	}

	/**
	 * 设置num
	 * 
	 * @param num
	 */
	public void setNum(Integer num) {
		this.num = num;
	}
	
	/**
	 * 获取alertNum
	 * 
	 * @return
	 */
	public Integer getAlertNum() {
		return alertNum;
	}

	/**
	 * 设置alertNum
	 * 
	 * @param alertNum
	 */
	public void setAlertNum(Integer alertNum) {
		this.alertNum = alertNum;
	}
	
	/**
	 * 获取image
	 * 
	 * @return
	 */
	public String getImage() {
		return image;
	}

	/**
	 * 设置image
	 * 
	 * @param image
	 */
	public void setImage(String image) {
		this.image = image;
	}
	
	/**
	 * 获取images
	 * 
	 * @return
	 */
	public String getImages() {
		return images;
	}

	/**
	 * 设置images
	 * 
	 * @param images
	 */
	public void setImages(String images) {
		this.images = images;
	}
	
	/**
	 * 获取weight
	 * 
	 * @return
	 */
	public Integer getWeight() {
		return weight;
	}

	/**
	 * 设置weight
	 * 
	 * @param weight
	 */
	public void setWeight(Integer weight) {
		this.weight = weight;
	}
	
	/**
	 * 获取createTime
	 * 
	 * @return
	 */
	public java.time.Instant getCreateTime() {
		return createTime;
	}

	/**
	 * 设置createTime
	 * 
	 * @param createTime
	 */
	public void setCreateTime(java.time.Instant createTime) {
		this.createTime = createTime;
	}
	
	/**
	 * 获取updateTime
	 * 
	 * @return
	 */
	public java.time.Instant getUpdateTime() {
		return updateTime;
	}

	/**
	 * 设置updateTime
	 * 
	 * @param updateTime
	 */
	public void setUpdateTime(java.time.Instant updateTime) {
		this.updateTime = updateTime;
	}
	
	/**
	 * 获取spuId
	 * 
	 * @return
	 */
	public String getSpuId() {
		return spuId;
	}

	/**
	 * 设置spuId
	 * 
	 * @param spuId
	 */
	public void setSpuId(String spuId) {
		this.spuId = spuId;
	}
	
	/**
	 * 获取categoryId
	 * 
	 * @return
	 */
	public Integer getCategoryId() {
		return categoryId;
	}

	/**
	 * 设置categoryId
	 * 
	 * @param categoryId
	 */
	public void setCategoryId(Integer categoryId) {
		this.categoryId = categoryId;
	}
	
	/**
	 * 获取categoryName
	 * 
	 * @return
	 */
	public String getCategoryName() {
		return categoryName;
	}

	/**
	 * 设置categoryName
	 * 
	 * @param categoryName
	 */
	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}
	
	/**
	 * 获取brandName
	 * 
	 * @return
	 */
	public String getBrandName() {
		return brandName;
	}

	/**
	 * 设置brandName
	 * 
	 * @param brandName
	 */
	public void setBrandName(String brandName) {
		this.brandName = brandName;
	}
	
	/**
	 * 获取spec
	 * 
	 * @return
	 */
	public String getSpec() {
		return spec;
	}

	/**
	 * 设置spec
	 * 
	 * @param spec
	 */
	public void setSpec(String spec) {
		this.spec = spec;
	}
	
	/**
	 * 获取saleNum
	 * 
	 * @return
	 */
	public Integer getSaleNum() {
		return saleNum;
	}

	/**
	 * 设置saleNum
	 * 
	 * @param saleNum
	 */
	public void setSaleNum(Integer saleNum) {
		this.saleNum = saleNum;
	}
	
	/**
	 * 获取commentNum
	 * 
	 * @return
	 */
	public Integer getCommentNum() {
		return commentNum;
	}

	/**
	 * 设置commentNum
	 * 
	 * @param commentNum
	 */
	public void setCommentNum(Integer commentNum) {
		this.commentNum = commentNum;
	}
	
	/**
	 * 获取status
	 * 
	 * @return
	 */
	public String getStatus() {
		return status;
	}

	/**
	 * 设置status
	 * 
	 * @param status
	 */
	public void setStatus(String status) {
		this.status = status;
	}
	
	/**
	 * 获取version
	 * 
	 * @return
	 */
	public Integer getVersion() {
		return version;
	}

	/**
	 * 设置version
	 * 
	 * @param version
	 */
	public void setVersion(Integer version) {
		this.version = version;
	}

	@Override
	public String toString() {
		return "TbSku [id=" + id + " , sn=" + sn + " , name=" + name + " , price=" + price + " , num=" + num + " , alertNum=" + alertNum + " , image=" + image + " , images=" + images + " , weight=" + weight + " , createTime=" + createTime + " , updateTime=" + updateTime + " , spuId=" + spuId + " , categoryId=" + categoryId + " , categoryName=" + categoryName + " , brandName=" + brandName + " , spec=" + spec + " , saleNum=" + saleNum + " , commentNum=" + commentNum + " , status=" + status + " , version=" + version + "  ]";
	
	}
	
	
}
